package js;

import java.util.Scanner;

class Student{
    protected String name;
    protected int age;
    Student(String name,int age){
        this.name = name;
        this.age = age;
    }
    void show(){
        System.out.println("Student[name="+name+",age="+age+"]");
    }
}

class Undergraduate extends Student{
    private String major;
    Undergraduate(String name,int age,String major){
        super(name,age);
        this.major = major;
    }
    void show(){
        System.out.println("Undergraduate[name="+name+",age="+age+",major="+major+"]");
    }
}
public class Main {
    public static void main(String[] args) {
        Scanner reader = new Scanner(System.in);
        String name1 = reader.next();
        int age1 = reader.nextInt();

        String name2 = reader.next();
        int age2 = reader.nextInt();
        String major = reader.next();

        Student object1 = new Student(name1,age1);
        object1.show();


        Undergraduate object2 = new Undergraduate(name2,age2,major);
        object2.show();
    }
}
